import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/sys/profile',
    method: 'post'
  })
}

export function staffPhoto(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '',
    method: ''
  })
}

/**
 * 更新员工基本信息
 * @param {*} data
 * @returns
 */
export function updateUserInfo(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
